package entity

import (
	"reflect"
	"strings"
)

type ProjectEntity struct {
	DocId                            string  `json:"docId"`
	EnterpriseId                     float64 `json:"enterpriseId,omitempty"`
	ProjectRoofType                  float64 `json:"projectRoofType,omitempty"`
	CityId                           float64 `json:"cityId,omitempty"`
	Irradiation                      string  `json:"irradiation,omitempty"`
	IndustryId                       float64 `json:"industryId,omitempty"`
	RoofOutline                      string  `json:"roofOutline,omitempty"`
	DiscountRecyclingCycle           float64 `json:"discountRecyclingCycle,omitempty"`
	DiscountFirstYearSaveElectricity float64 `json:"discountFirstYearSaveElectricity,omitempty"`
	ProvinceId                       float64 `json:"provinceId,omitempty"`
	PersonnelSizeTypeDesc            string  `json:"personnelSizeTypeDesc,omitempty"`
	Name                             string  `json:"name,omitempty"`
	ProvinceName                     string  `json:"provinceName,omitempty"`
	DiscountInternalRateOfReturn     float64 `json:"discountInternalRateOfReturn,omitempty"`
	FirstYearSaveElectricity         float64 `json:"firstYearSaveElectricity,omitempty"`
	DiscountRoe                      float64 `json:"discountRoe,omitempty"`
	InternalRateOfReturn             float64 `json:"internalRateOfReturn,omitempty"`
	Roe                              float64 `json:"roe,omitempty"`
	InstalledPV                      float64 `json:"installedPV,omitempty"`
	KwhCost                          float64 `json:"kwhCost,omitempty"`
	RecyclingCycle                   float64 `json:"recyclingCycle,omitempty"`
	YearsOfEstablishmentType         float64 `json:"yearsOfEstablishmentType,omitempty"`
	IndustryParentName               string  `json:"industryParentName,omitempty"`
	YearsOfEstablishment             string  `json:"yearsOfEstablishment,omitempty"`
	CityName                         string  `json:"cityName,omitempty"`
	SystemCost                       float64 `json:"systemCost,omitempty"`
	PersonnelSizeType                float64 `json:"personnelSizeType,omitempty"`
	ImageUrl                         string  `json:"imageUrl,omitempty"`
	ResourceRaise                    float64 `json:"resourceRaise,omitempty"`
	RegisterDate                     float64 `json:"registerDate,omitempty"`
	IndustryName                     string  `json:"industryName,omitempty"`
	IndustryParentId                 float64 `json:"industryParentId,omitempty"`
	UsedProportion                   float64 `json:"usedProportion,omitempty"`
	Address                          string  `json:"address,omitempty"`
	SystemCapacity                   float64 `json:"systemCapacity,omitempty"`
	DistrictName                     string  `json:"districtName,omitempty"`
	CompanyType                      float64 `json:"companyType,omitempty"`
	UpdateTime                       float64 `json:"updateTime,omitempty"`
	AddTestField                     bool    `json:"addTestField,omitempty"`
	IsVip                            bool    `json:"isVip,omitempty"`
	AnnualEnergyProduction           float64 `json:"annualEnergyProduction,omitempty"`
	IndustryFullName                 string  `json:"industryFullName,omitempty"`
	DistrictId                       float64 `json:"districtId,omitempty"`
	CreateTime                       float64 `json:"createTime,omitempty"`
	ContactWay                       string  `json:"contactWay,omitempty"`
	Location                         string  `json:"location,omitempty"`
	IsHighEnergy                     bool    `json:"isHighEnergy,omitempty"`
	Contacts                         string  `json:"contacts,omitempty"`
	TotalArea                        float64 `json:"totalArea,omitempty"`
}

func NewProjectEntity() *ProjectEntity {
	return &ProjectEntity{}
}

func (entity *ProjectEntity) IndexName() string {
	return "t_project_index"
}

// FieldNames 获取字段名称
func (entity *ProjectEntity) FieldNames() []string {
	types := reflect.TypeOf(entity)
	var fieldNameArr []string
	elem := types.Elem()
	for i := 0; i < elem.NumField(); i++ {
		name := elem.Field(i).Name
		fieldNameArr = append(fieldNameArr, strings.ToLower(name)[:1]+name[1:])
	}
	return fieldNameArr
}
